import unittest
from  selenium import webdriver
from page.RegeditPage import RegeditPage
import time
class RegedtCase(unittest.TestCase):

    def setUp(self):
        self.fox = webdriver.Chrome()
        self.baseurl = "http://lovewx999.xyz/member.php?mod=register"
        self.title="立即注册 -  Discuz! Board -  Powered by Discuz!"

    def test_regedit(self):
        """
        正确用户名和密码注册成功！
        :return:
        """
        regeditPage = RegeditPage(self.fox, self.baseurl, self.title)
        regeditPage.open()
        regeditPage.input_username("test22")
        regeditPage.input_password("123321")
        regeditPage.input_password2("123321")
        regeditPage.input_email("test22@qq.com")
        regeditPage.click_submit()
        time.sleep(3)
        self.assertEqual(self.fox.title,u"立即注册 -  Discuz! Board -  Powered by Discuz!","【新提醒】论坛 - Powered by Discuz!")

    def tearDown(self):
        self.fox.quit()
